package org.icnmasjid.member.model;
// Generated Dec 6, 2008 9:23:44 PM by Hibernate Tools 3.1.0.beta4

import java.sql.Timestamp;


/**
 * @struts.form include-all="true" extends="BaseForm"
 * @hibernate.class
 *         table="login"
 *     
 */

public class Login extends org.icnmasjid.member.model.BaseObject implements java.io.Serializable {


    // Fields    

    private Integer id;
    private String username;
    private String passWord;
    private Timestamp lastLogin;
    private Timestamp lastPasswordChanged;


    // Constructors

    /** default constructor */
    public Login() {
    }

	/** minimal constructor */
    public Login(String username, String passWord) {
        this.username = username;
        this.passWord = passWord;
    }
    
    /** full constructor */
    public Login(String username, String passWord, Timestamp lastLogin, Timestamp lastPasswordChanged) {
        this.username = username;
        this.passWord = passWord;
        this.lastLogin = lastLogin;
        this.lastPasswordChanged = lastPasswordChanged;
    }
    

   
    // Property accessors
    /**       
     *      *            @hibernate.id
     *             generator-class="native"
     *             type="java.lang.Integer"
     *             column="id"
     *         
     */

    public Integer getId() {
        return this.id;
    }
    
    public void setId(Integer id) {
        this.id = id;
    }
    /**       
     *      *            @hibernate.property
     *             column="username"
     *             unique="true"
     *             length="50"
     *             not-null="true"
     *         
     */

    public String getUsername() {
        return this.username;
    }
    
    public void setUsername(String username) {
        this.username = username;
    }
    /**       
     *      *            @hibernate.property
     *             column="pass_word"
     *             length="50"
     *             not-null="true"
     *         
     */

    public String getPassWord() {
        return this.passWord;
    }
    
    public void setPassWord(String passWord) {
        this.passWord = passWord;
    }
    /**       
     *      *            @hibernate.property
     *             column="last_login"
     *             length="19"
     *         
     */

    public Timestamp getLastLogin() {
        return this.lastLogin;
    }
    
    public void setLastLogin(Timestamp lastLogin) {
        this.lastLogin = lastLogin;
    }
    /**       
     *      *            @hibernate.property
     *             column="last_password_changed"
     *             length="19"
     *         
     */

    public Timestamp getLastPasswordChanged() {
        return this.lastPasswordChanged;
    }
    
    public void setLastPasswordChanged(Timestamp lastPasswordChanged) {
        this.lastPasswordChanged = lastPasswordChanged;
    }
   

    /**
     * toString
     * @return String
     */
     public String toString() {
	  StringBuffer buffer = new StringBuffer();

      buffer.append(getClass().getName()).append("@").append(Integer.toHexString(hashCode())).append(" [");
      buffer.append("username").append("='").append(getUsername()).append("' ");			
      buffer.append("passWord").append("='").append(getPassWord()).append("' ");			
      buffer.append("lastLogin").append("='").append(getLastLogin()).append("' ");			
      buffer.append("lastPasswordChanged").append("='").append(getLastPasswordChanged()).append("' ");			
      buffer.append("]");
      
      return buffer.toString();
     }


   public boolean equals(Object other) {
         if ( (this == other ) ) return true;
		 if ( (other == null ) ) return false;
		 if ( !(other instanceof Login) ) return false;
		 Login castOther = ( Login ) other; 
         
		 return ( (this.getId()==castOther.getId()) || ( this.getId()!=null && castOther.getId()!=null && this.getId().equals(castOther.getId()) ) )
 && ( (this.getUsername()==castOther.getUsername()) || ( this.getUsername()!=null && castOther.getUsername()!=null && this.getUsername().equals(castOther.getUsername()) ) )
 && ( (this.getPassWord()==castOther.getPassWord()) || ( this.getPassWord()!=null && castOther.getPassWord()!=null && this.getPassWord().equals(castOther.getPassWord()) ) )
 && ( (this.getLastLogin()==castOther.getLastLogin()) || ( this.getLastLogin()!=null && castOther.getLastLogin()!=null && this.getLastLogin().equals(castOther.getLastLogin()) ) )
 && ( (this.getLastPasswordChanged()==castOther.getLastPasswordChanged()) || ( this.getLastPasswordChanged()!=null && castOther.getLastPasswordChanged()!=null && this.getLastPasswordChanged().equals(castOther.getLastPasswordChanged()) ) );
   }
   
   public int hashCode() {
         int result = 17;
         
         result = 37 * result + ( getId() == null ? 0 : this.getId().hashCode() );
         result = 37 * result + ( getUsername() == null ? 0 : this.getUsername().hashCode() );
         result = 37 * result + ( getPassWord() == null ? 0 : this.getPassWord().hashCode() );
         result = 37 * result + ( getLastLogin() == null ? 0 : this.getLastLogin().hashCode() );
         result = 37 * result + ( getLastPasswordChanged() == null ? 0 : this.getLastPasswordChanged().hashCode() );
         return result;
   }   





}
